﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;

namespace MyCpuMonitor.Classes
{
    public class CpuInfoItem
    {
        /// <summary>
        /// Name of the Cpu Item e.g. Name, NumberOfProcessors etc
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// Value of the item e.g. Intel Core i7
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// Used so we dont have to got CpuItem aaa = new CpuItem();
        /// We can just go CpuItem.Create("Bob","Fred");
        /// </summary>
        /// <param name="caption">Name of the Cpu Item</param>
        /// <param name="value">Value of the item</param>
        /// <returns>New instance of CpuItem</returns>
        public static CpuInfoItem Create(string name, string value)
        {
            var c = new CpuInfoItem();
            c.Name = name;
            c.Value = value;

            return c;
        }

        /// <summary>
        /// Nicer looking string representation of the CpuInfo
        /// </summary>
        /// <returns>String representation of the CpuInfo</returns>
        public override string ToString()
        {
            return string.Format("{0}: {1}", Name, Value);
        }
    }
}
